common/vsprintf: fix return value when formatting symbolic addresses
authorJan Beulich <jbeulich@suse.com>
Tue, 3 Dec 2013 08:57:41 +0000 (09:57 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 3 Dec 2013 08:57:41 +0000 (09:57 +0100)
commitfd62e281dfe6183cd140cf2cf2bca1a10b574aa7
tree322a3c593ec625643390d47d8a4cfb71a8160135
parenta5ca03ea2f48ceedd835ba938999dc9c5e6a4690
common/vsprintf: fix return value when formatting symbolic addresses

When the buffer to be formatted to is too small, the function return
value is expected to be the number of characters that would be printed
(particularly important if that value is then used for allocating a
buffer). Hence incrementing the active pointer must always be
independent of actually storing a character.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/common/vsprintf.c